package io.renren.modules.skate.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.renren.common.service.impl.CrudServiceImpl;
import io.renren.common.constant.Constant;
import io.renren.common.utils.ConvertUtils;
import io.renren.modules.skate.dao.FContestItemDao;
import io.renren.modules.skate.dto.FClubDTO;
import io.renren.modules.skate.dto.FContestItemDTO;
import io.renren.modules.skate.entity.FClubEntity;
import io.renren.modules.skate.entity.FContestItemEntity;
import io.renren.modules.skate.service.FContestItemService;
import io.renren.modules.security.user.SecurityUser;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 赛项表
 *
 * @author Mark sunlightcs@gmail.com
 * @since 3.0 2023-11-28
 */
@Service
public class FContestItemServiceImpl extends CrudServiceImpl<FContestItemDao, FContestItemEntity, FContestItemDTO> implements FContestItemService {

    @Override
    public QueryWrapper<FContestItemEntity> getWrapper(Map<String, Object> params){
        QueryWrapper<FContestItemEntity> wrapper = new QueryWrapper<>();


        return wrapper;
    }

    @Override
    public FContestItemDTO queryByName(String itemName) {

        FContestItemEntity fContestItemEntity = baseDao.selectOne(new QueryWrapper<FContestItemEntity>().eq("item_name", itemName).last("limit 1"));


        return ConvertUtils.sourceToTarget(fContestItemEntity, currentDtoClass());
    }

}